#NoTrayIcon

$TPID=0    ; 0: none 1: AVC 2: Synaptics  3: ELan


Run("Setup.exe")

Sleep(3000)

If WinExists("Finger Sensing Pad Driver Installer") Then
   $TPID=1
ElseIf WinExists("Synaptics Pointing Device Driver Installation") Then
   $TPID=2
ElseIf WinExists("ELAN Input Device Driver Installation") Then
   $TPID=3
EndIf

Switch $TPID
   Case 0
		 MsgBox(48, "Error", "Not define")
   case 1
	  ControlClick("Finger Sensing Pad Driver Installer", "", "[CLASS:Button; INSTANCE:2]")
	  Do
		 Sleep(3000)
		 $Msg=ControlGetText("Finger Sensing Pad Driver Installer", "", "[CLASS:Button; INSTANCE:7]")
		 Until (StringInStr($Msg, "Finish") = 1) And (ControlCommand("Finger Sensing Pad Driver Installer","","[CLASS:Button; INSTANCE:7]","IsVisible") = 1)

		 Sleep(3000)
		 ControlClick("Finger Sensing Pad Driver Installer", "", "[CLASS:Button; INSTANCE:7]")
   Case 2
	  ControlClick("Synaptics Pointing Device Driver Installation", "", "[CLASS:Button; INSTANCE:2]")
	  Sleep(1000)
	  ControlClick("Synaptics Pointing Device Driver Installation", "", "[CLASS:Button; INSTANCE:1]")
	  Sleep(1000)
	  ControlClick("Synaptics Pointing Device Driver Installation", "", "[CLASS:Button; INSTANCE:6]")
	  Do
		 Sleep(3000)
		 $Msg=ControlGetText("Synaptics Pointing Device Driver Installation", "", "[CLASS:Button; INSTANCE:7]")
		 Until (StringInStr($Msg, "Finish") = 1) And (ControlCommand("Synaptics Pointing Device Driver Installation","","[CLASS:Button; INSTANCE:7]","IsVisible") = 1)

		 Sleep(3000)
		 ControlClick("Synaptics Pointing Device Driver Installation", "", "[CLASS:Button; INSTANCE:7]")
   Case 3
	  ControlClick("ELAN Input Device Driver Installation", "", "[CLASS:Button; INSTANCE:2]")
	  Sleep(1000)
	  ControlClick("ELAN Input Device Driver Installation", "", "[CLASS:Button; INSTANCE:1]")
	  Sleep(1000)
	  ControlClick("ELAN Input Device Driver Installation", "", "[CLASS:Button; INSTANCE:6]")
	  Do
		 Sleep(3000)
		 $Msg=ControlGetText("ELAN Input Device Driver Installation", "", "[CLASS:Button; INSTANCE:7]")
		 Until (StringInStr($Msg, "Finish") = 1) And (ControlCommand("ELAN Input Device Driver Installation","","[CLASS:Button; INSTANCE:7]","IsVisible") = 1)

		 Sleep(3000)
		 ControlClick("ELAN Input Device Driver Installation", "", "[CLASS:Button; INSTANCE:7]")
EndSwitch